package com.lintf.flowable.token.user;

/**
 * @author lin tingfeng
 * @system Mac
 * @data 2024/5/16 17:09
 * @package_name com.qtone.config.token.user
 * @project_name ZHXLProject
 * @desc
 */

public class UserContext {
    private static final ThreadLocal<UserToken> USER_CONTEXT = new ThreadLocal<>();

    public static void setUser(UserToken user) {
        USER_CONTEXT.set(user);
    }

    public static UserToken getUser() {
        return USER_CONTEXT.get();
    }

    public static void clear() {
        USER_CONTEXT.remove();
    }
}

